﻿namespace Nomo.UnityCoreModule.Waiters
{
    /// <summary>
    /// 谓词等待器。
    /// </summary>
    public abstract class PredicateWaiter : Waiter
    {
        private protected readonly System.Func<bool> Predicate;

        private protected PredicateWaiter(System.Func<bool> predicate)
        {
            Predicate = predicate ?? throw new System.ArgumentNullException();
        }

        /// <inheritdoc />
        public sealed override bool MoveNext()
        {
            return base.MoveNext();
        }

        /// <inheritdoc />
        public sealed override void Reset()
        {
            base.Reset();
        }
    }
}
